package com.zy.smbms.service;

import com.zy.smbms.UserMapper.SmbmsBillMapper;
import com.zy.smbms.pojo.SmbmsBill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class SmbmsBillServiceImpl implements SmbmsBillService
{
    @Autowired
    private SmbmsBillMapper smbmsBillMapper;

    //查询所有数量
    @Override
    public int selectTotalCount(SmbmsBill bill)
    {
        return smbmsBillMapper.selectTotalCount(bill);
    }

    //分页查询
    @Override
    public List<SmbmsBill> selectiveBillList(Map<String, Object> map)
    {
        return smbmsBillMapper.selectBillList(map);
    }

    //根据主键查询
    @Override
    public SmbmsBill queryBillById(Long id)
    {
        return smbmsBillMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateBillById(SmbmsBill bill)
    {
        return smbmsBillMapper.updateByPrimaryKeySelective(bill);
    }

    @Override
    public int addBill(SmbmsBill bill)
    {
        return smbmsBillMapper.insertSelective(bill);
    }

    @Override
    public int deleteBillById(Long id)
    {
        return smbmsBillMapper.deleteByPrimaryKey(id);
    }
}
